#pragma once

#include "GdfSingleton.h"

namespace Gdf
{
	class __GDF_EXPORT GdfWindow
	{
	public:
		GdfWindow(HINSTANCE&);
		virtual ~GdfWindow();

		virtual bool WindowCreate() = 0;
		virtual bool WindowDestroy() = 0;
		virtual void WindowShow(bool bShow) = 0;

		const HINSTANCE GetHInstance() { return mhInstance; }
		const HWND GetHwnd() { return mHwnd; }

	protected:
		HINSTANCE mhInstance;
		HWND mHwnd;
	};

	//-----------------------------------------------------------------//
	class GdfWindowManager : public GdfSingleton<GdfWindowManager>
	{
	public:
		GdfWindowManager();
		~GdfWindowManager();

		void AddWindow(GdfWindow* window);
		void DeleteWindow(GdfWindow* window);
		void MessagePump();

	private:
		typedef std::vector<GdfWindow*> WindowList;
		WindowList mWindowList;
		CRITICAL_SECTION mCS;
	};
}